<script>
    var socket = new WebSocket('ws://localhost:3000/test');
    socket.addEventListener('open', function (event) {
        socket.send("Hello Server!");
    });
    socket.addEventListener('message', function (event) {
        alert('Message from server:'+ event.data);
    });
</script>  
  